home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group96b.txt / 000036_icon-group-sender _Sun Oct 20 19:17:45 1996.msg < prev    next >
Internet Message Format  |  1997-01-02  |  1KB

  1. Received: by cheltenham.cs.arizona.edu; Mon, 21 Oct 1996 10:19:14 MST
  2. Message-Id: <3.0b26.32.19961020191730.0068ec34@inforoute.cgs.fr>
  3. X-Sender: grodzens@inforoute.cgs.fr (Unverified)
  4. X-Mailer: Windows Eudora Pro Version 3.0b26 (32)
  5. X-Priority: 1 (Highest)
  6. Date: Sun, 20 Oct 1996 19:17:45 +0100
  7. To: Gordon Peterson <gep2@computek.net>
  8. From: Vladimir <vladimir.grodzenski@InfoRoute.CGS.Fr>
  9. Subject: re: cute nightmare
  10. Cc: icon-group@cs.arizona.edu
  11. Mime-Version: 1.0
  12. Content-Type: text/plain; charset="us-ascii"
  13. Errors-To: icon-group-errors@cs.arizona.edu
  14.  
  15. Hi Gordon,
  16.  
  17. I finally rewrite in Icon a procedure that checks the Credit Card number as
  18. it desribed on http://beachnet.com/~hstiles/cardtype.html
  19.  
  20. procedure CheckSum(s)
  21. local ccard, checksum
  22.     if *( cset(s) -- &digits -- ' -' ) > 0 then fail
  23.     ccard:= list()
  24.     every put(ccard, integer(!ccard) )
  25.  
  26.     every i:= *ccard-1 to 1 by -2 do ccard[i]*:= 2
  27.     checksum:= 0
  28.     every checksum +:= !!X
  29.     return checksum
  30. end
  31.  
  32. Less than 5 min. in all, including the access to the home page mentioned
  33. above. Actually, the Internet connection was pretty fast :-)
  34.  
  35. Vladimir
  36. Best regards
  37. =================================================
  38. Cognitive Technology (Europe)
  39. Phone: +33 1 43375920; Fax: +33 1 43370512
  40. Compuserve: 100700,526
  41. Home Page:  http://www.ocr.com
  42. FTP:   ftp://ftp.ocr.com/ocr
  43. =================================================
  44.